Merge Them

If you are translating a complete Pascal program, consisting of multiple source and unit files, it is far better to edit ALL the files at once.  Chances are what produces a compiler error in one file will produce them in others.  It’s better to correct an error throughout the entire source/header area, than to set up “Find/Replace” several times, one file at a time

To do this, get a complete CTools™ output for ALL the files.  Units and .p files.  Pascal programs sometimes have a “Globals.p” file (with whatever actual name).  CTools™ will save it as “Globals.p.c” but it will eventually end up being the main header file, “Globals.h.”  What you need to do is MERGE all files (kilobyte size permitting) and put all global data files at the top.  You can separate them back into .c files later, but for the purposes of manual editing, it is essential to have the least number of files (preferably one) as possible.

My Think C has been allocated with enough memory to easily handle a 300K merged file.  Set yours up to the maximum possible - within reason.

What I do is run all the files through CTools™ Pascal to C, then select all the output files destined to become headers and drop them on TextMerge by Robert Gibson.  This creates a new file called “Merged File 0” and consists of copies of the content of all the files in alpha. order (View by Name).  I do the same with what will become sources and it’s named “Merged File 1”.  Then I drop both these on the merger and it outputs “Merged File 2” which I rename to Merged.c.

Your alphabetical order is changed by adding an ‘a’ prefix to some file names and a ‘z’ to others, prior to the merge.  Once merged, the Merged File 3 is renamed “Merge.c” (or the program name) for editing.  Dump the first merges, retaining only the rough translation files (put all their names back like they were) and Merge.c.

One advantage is you now have copies of your CTools™ output, in case you want to revert to, or refer to, any of it in editing the merged file.  But the main advantage is you only have to correct one thing ONCE instead of for each file.  And you do the correction for the whole program the FIRST ime it is encountered.

Navigation from file to file without excessive scrolling is a snap with CMaster™ (or your “Command E” and then Command G without CMaster™) by selecting the word “translation” and using the up/down search arrows.  That’s a unique word in the merged file and appears at the top of EACH individual file which was merged.